home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 9 / 009.d81 / alpha dir (.txt) < prev    next >
Encoding:
Commodore BASIC  |  1985-01-01  |  1.4 KB  |  56 lines

  1. 5 dimf$(144)
  2. 100 :
  3. 110 print" in alaphabetical order."
  4. 120 print" print on s[146]creen or p[146]rinter?"
  5. 130 getod$:ifod$="p"orod$<>""then150
  6. 140 goto130
  7. 150 print" ** reading the directory **"
  8. 160 b=6:c=2:q$=chr$(34):r$="":sp$="                 "
  9. 170 open1,8,0,"$":get#1,a$,b$
  10. 180 get#1,a$,b$:rem link
  11. 190 get#1,a$,b$:nb=asc(a$+chr$(0))+256*asc(b$+chr$(0)):rem # of blocks
  12. 200 get#1,b$:ifst<>0then290
  13. 210 ifb$<>chr$(34)then200
  14. 220 get#1,b$:ifb$<>chr$(34)thens$=s$+b$:goto220
  15. 230 get#1,b$:ifb$=chr$(32)then230
  16. 240 c$="":ifa=0thenc$=" "
  17. 250 c$=c$+b$:get#1,b$:ifb$<>""then250
  18. 260 f$(a)=left$(r$+q$+s$+q$+sp$,19)+left$(c$,b)+"[146]"+mid$(str$(nb)+sp$,2,c)
  19. 270 s$="":r$="":a=a+1:b=3:c=5
  20. 280 ifst=0then180
  21. 290 close1:n=a-1:bf$=mid$(str$(nb)+" blocks free, "+str$(n)+" files.",2)
  22. 300 print" ** sorting directory **"
  23. 310 m=n
  24. 320 m=int(m/2)
  25. 330 ifm=0then470
  26. 340 j=1:k=n-m
  27. 350 i=j
  28. 360 l=i+m
  29. 370 cm=cm+1
  30. 380 iff$(i)<f$(l)then440
  31. 390 t$=f$(i):f$(i)=f$(l):f$(l)=t$
  32. 400 sw=sw+1
  33. 410 i=i-m
  34. 420 ifi<1then440
  35. 430 goto360
  36. 440 j=j+1
  37. 450 ifj>kthen320
  38. 460 goto350
  39. 470 ifod$="p"thenopen4,4:print" ** printing directory **":cmd4
  40. 480 ifod$<>"p"thenprint"[147]"
  41. 490 c=2:fori=0ton:printright$(f$(i),c)left$(f$(i),len(f$(i))-c):c=5:
  42. 500 next:printbf$
  43. 510 ifod$="p"thenprint:print:print:print#4:close4:goto61000
  44. 60000 rem   see listing again
  45. 60010 print"do you want to see the listing again?"
  46. 60020 poke198,0:wait198,1:getk$:ifk$<>"y"andk$<>"n"then60020
  47. 60030 ifk$="y"then480
  48. 60040 :
  49. 61000 print"[147]do you want to do another disk?"
  50. 61020 poke198,0:wait198,1:getk$:ifk$<>"y"andk$<>"n"then60020
  51. 61030 ifk$="y"thena=0:goto100
  52. 61040 :
  53. 63000 rem    connect back to l.s.
  54. 63002 print"[147]load"chr$(34)"c.payload"chr$(34)",8":print"run"
  55. 63004 poke198,0:poke631,13:poke632,13:poke198,2:end
  56.